package com.ruoyi.company.study.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.company.study.mapper.StudyTrainMapper;
import com.ruoyi.company.study.domain.StudyTrain;
import com.ruoyi.company.study.service.IStudyTrainService;
import com.ruoyi.common.core.text.Convert;

/**
 * 学习培训Service业务层处理
 * 
 * @author tzn
 * @date 2020-12-18
 */
@Service
public class StudyTrainServiceImpl implements IStudyTrainService 
{
    @Autowired
    private StudyTrainMapper studyTrainMapper;

    /**
     * 查询学习培训
     * 
     * @param studyId 学习培训ID
     * @return 学习培训
     */
    @Override
    public StudyTrain selectStudyTrainById(Long studyId)
    {
        return studyTrainMapper.selectStudyTrainById(studyId);
    }

    /**
     * 查询学习培训对象
     *
     * @param ids 需要查询的数据ID
     * @return 结果
     */
    @Override
    public List<StudyTrain> selectStudyTrainByIds(String ids)
    {
        return studyTrainMapper.selectStudyTrainByIds(Convert.toStrArray(ids));
    }

    /**
     * 查询学习培训列表
     * 
     * @param studyTrain 学习培训
     * @return 学习培训
     */
    @Override
    public List<StudyTrain> selectStudyTrainList(StudyTrain studyTrain)
    {
        return studyTrainMapper.selectStudyTrainList(studyTrain);
    }

    /**
     * 新增学习培训
     * 
     * @param studyTrain 学习培训
     * @return 结果
     */
    @Override
    public int insertStudyTrain(StudyTrain studyTrain)
    {
        studyTrain.setCreateTime(DateUtils.getNowDate());
        return studyTrainMapper.insertStudyTrain(studyTrain);
    }

    /**
     * 修改学习培训
     * 
     * @param studyTrain 学习培训
     * @return 结果
     */
    @Override
    public int updateStudyTrain(StudyTrain studyTrain)
    {
        return studyTrainMapper.updateStudyTrain(studyTrain);
    }

    /**
     * 删除学习培训对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteStudyTrainByIds(String ids)
    {
        return studyTrainMapper.deleteStudyTrainByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除学习培训信息
     * 
     * @param studyId 学习培训ID
     * @return 结果
     */
    @Override
    public int deleteStudyTrainById(Long studyId)
    {
        return studyTrainMapper.deleteStudyTrainById(studyId);
    }
}
